<script>
import TencentCloudChat from '@tencentcloud/chat';
import TIMUploadPlugin from 'tim-upload-plugin';
import { TUILogin } from '@tencentcloud/tui-core';
import { TUIUserService } from '@tencentcloud/chat-uikit-engine';
uni.$SDKAppID = 1600051499; // Your SDKAppID
/* uni.$userID = '2'; // Your userID
uni.$userSig =
	'eJyrVgrxCdZLrSjILEpVsjI0NTU1MjAw0AGLlqUWKVkpGekZKEH4xSnZiQUFmSlAdWZARaaGJpaWEJnMlNS8ksy0TIgGmPLMdCCvwj8kJyQgzzu-pCDdy6PCMrHIsDjAOcMgPcfMyCy52CzUsTw1NDXXqDzIxBaqsSQzF*QWcyMzC0NLc2PTWgBd3TAH'; // Your userSig */
uni.$userID = '5'; // Your userID
uni.$userSig =
	'eJyrVgrxCdZLrSjILEpVsjI0NTU1MjAw0AGLlqUWKVkpGekZKEH4xSnZiQUFmSlAdWZARaaGJpaWEJnMlNS8ksy0TLAGU5jyzHQgr6q4MNzY2zgv3NzLKNfTvcKs0NA81d3Yx9Ivz9Q1Lz0iKSTfNN1Iu8rEwMAWqrEkMxfkFnMjM3NLcwMD81oAG9kulA__'; // Your userSig

export default {
	onLaunch: function () {
		console.log('App Launch');
		TUILogin.login({
			SDKAppID: uni.$SDKAppID,
			userID: uni.$userID,
			userSig: uni.$userSig,
			useUploadPlugin: true,
			framework: 'vue3'
		})
			.then(() => {
				console.log('登录tim成功');
				// TUIUserService.switchUserStatus({ displayOnlineStatus: true });
			})
			.catch((err) => {
				console.error(err);
			});
		// 创建IM sdk实例
		/* const tim = TencentCloudChat.create({
			SDKAppID: 1600051499
		});
		tim.setLogLevel(0); //设置日志级别为普通级别
		// tim.setLogLevel(1); // release 级别，SDK 输出关键信息，生产环境时建议使用
		// 注册上传插件
		tim.registerPlugin({
			'tim-upload-plugin': TIMUploadPlugin
		});
		//登录im后台
		tim.login({
			userID: uni.$userID,
			userSig: uni.$userSig
		})
			.then((res) => {
				console.log('登录im成功');
			})
			.catch((err) => {
				console.log(err);
			});
		uni.$tim = tim; */
	},
	onShow: function () {
		console.log('App Show');
	},
	onHide: function () {
		console.log('App Hide');
	}
};
</script>

<style>
/*每个页面公共css*/
@import '@/common/style/reset.css';
@import '@/common/style/iconfont.css';
</style>
